package com.jackson.passjava.common.utils;

import net.sf.json.JSONObject;

import java.util.Objects;

/**
 * @author LiYuhang
 * @version 0.1
 * @application
 * @Date 2021/8/23 16:15
 */
public class ResultUtil {



    public static  <T> T convertToJavaBean(Object objectStr,Class clazz){

        JSONObject jsonObject= JSONObject.fromObject(objectStr); // 将数据转成json字符串

        return  (T)JSONObject.toBean(jsonObject, clazz); //将json转成需要的对象

    }
}
